package com.audaque.springboot.foshanupload.web.nettydemo.handler;


import cn.hutool.json.JSONUtil;
import com.audaque.springboot.foshanupload.web.nettydemo.model.req.MessageReq;
import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.ChannelInboundHandlerAdapter;
import io.netty.handler.codec.http.FullHttpRequest;
import io.netty.handler.codec.http.websocketx.TextWebSocketFrame;

public class EchoInboundHandler2 extends ChannelInboundHandlerAdapter {
    //读空闲事件计数
    public static Integer readIdleTimes = 0;
    @Override
    public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception {
        System.out.println("进入 EchoInboundHandler2.channelRead");
        EchoInboundHandlerUtils.channelRead(ctx,msg);
        System.out.println("退出 EchoInboundHandler2 channelRead");
    }

    @Override
    public void channelReadComplete(ChannelHandlerContext ctx) throws Exception {
        System.out.println("[EchoInboundHandler2.channelReadComplete]读取数据完成");
    }

    @Override
    public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception {
        System.out.println("[EchoInboundHandler2.exceptionCaught]");
    }
    @Override
    public void userEventTriggered(ChannelHandlerContext ctx, Object evt) throws Exception {
        EchoInboundHandlerUtils.userEventTriggeredClose(ctx, evt);
    }

}
